package com.ybb.service;

import com.ybb.dao.ProviderDao;
import com.ybb.dao.ProviderDaoImpl;
import com.ybb.pojo.Provider;
import com.ybb.pojo.User;

import java.util.List;

public class ProviderServiceImpl implements ProviderService {
    private ProviderDao providerDao = new ProviderDaoImpl(); // 依赖DAO层


    @Override
    public List<Provider> getProviderList(String proCode, String proName) {
        return providerDao.getProviderList(proCode, proName); // 同步返回类型
    }

    @Override
    public int getProviderCount(String proCode, String proName) {
        // 可添加业务逻辑（如缓存处理、数据统计等）
        return providerDao.getProviderCount(proCode, proName);
    }

    @Override
    public Provider getProviderByUid(long uid) {
        return providerDao.getProviderByUid(uid);
    }


    @Override
    public int upDateProvider(Provider provider) {
        return providerDao.upDateProvider(provider);
    }


    @Override
    public int deleteProvider(Long proid) {
        return providerDao.deleteProvider(proid);
    }


    @Override
    public boolean isExist(Long proid) {
        return providerDao.isExist(proid);
    }

    @Override
    public int insertProvider(Provider provider) {
        return providerDao.insertProvider(provider);
    }
}
